package ToStr;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Objects;

public class StuTex {
    public static void main(String[] args) {
        Student student=new Student("ZHNGN","44");
        Student student2=new Student("ZHNGN","44");
        System.out.println(student);
        System.out.println(student.toString());
        System.out.println(student==student2);
        System.out.println(student.equals(student2));
        String s = Objects.toString(student);
    Student stu=null;
    Objects.toString(stu,"55");
        System.out.println(stu);
        Objects.isNull(stu);
        System.out.println(stu);
        boolean b = Objects.nonNull(stu);
        System.out.println(b);
        BigDecimal bigDecimal1=new BigDecimal("0.1");
        BigDecimal bigDecimal2=new BigDecimal("0.3");
        BigDecimal add = bigDecimal1.add(bigDecimal2);
        BigDecimal subtract = bigDecimal1.subtract(bigDecimal2);
        BigDecimal multiply = bigDecimal1.multiply(bigDecimal2);
        BigDecimal divide = bigDecimal1.divide(bigDecimal2,2, RoundingMode.FLOOR);
        BigDecimal divide1 = bigDecimal1.divide(bigDecimal2,3, RoundingMode.HALF_UP);
        BigDecimal divide2 = bigDecimal1.divide(bigDecimal2,2, RoundingMode.UP);
        BigDecimal divide3 = bigDecimal1.divide(bigDecimal2,2, BigDecimal.ROUND_FLOOR);

        System.out.println(divide1);
        System.out.println(divide2);
        System.out.println(divide3);


        System.out.println(divide);

        System.out.println(multiply);

        System.out.println(add);
        System.out.println(subtract);



    }

}
